package com.ling.pl.autoproject.builder.exporter;

import com.ling.pl.autoproject.builder.model.OneToManyPojo;
import com.ling.pl.autoproject.builder.model.POJOClass;

import java.io.File;

public class MVCRelationExporter extends OneAndRelationExporter {

    public MVCRelationExporter(String baseDir, OneToManyPojo oneToManyPojo,
                               String template, String relationPath, String file_end_str) {
        super(baseDir, oneToManyPojo, template, relationPath, file_end_str);
    }

    protected void processResultFolder() {
        destination_str = rootdir_str + result_str;
        log.info(destination_str);
        destination = new File(destination_str);
        ensureExistence(destination);
    }

    protected String getResult_str(POJOClass pojoClass) {
        String result_str = relationPath + oneToManyPojo.getOne().getDeclarationName() + pojoClass.getDeclarationName() + file_end_str;
        return result_str;
    }
}
